#include "stdafx.h"
#include "../../vehicles.h"
#include <string>
#include <iostream>

using namespace std;

void printVehicleDetails(Van *van)
{
	if(van==NULL)
		return;

	cout << "---------------------------------------------" << endl;
	cout << "RegNum: " << van->getRegNum() << endl;
	cout << "Make: " << van->getMake() << endl;
	cout << "Model: " << van->getModel() << endl;
	cout << "In rent: " << (van->getInRent()?"true":"false") << endl;
	cout << "Age: " << van->getAge() << endl;
	cout << "Auto Gearbox: " << (van->getAutoGearbox()?"true":"false") << endl;
	cout << "Storage space: " << van->getStorageSpace() << endl;
	cout << "Weight allowance: " << van->getWeightAllowance() << endl;
	cout << "Height: " << van->getVehicleHeight() << endl;
	cout << "---------------------------------------------" << endl;
}

void printVehicleDetails(Car *car)
{
	if(car==NULL)
		return;

	cout << "---------------------------------------------" << endl;
	cout << "RegNum: " << car->getRegNum() << endl;
	cout << "Make: " << car->getMake() << endl;
	cout << "Model: " << car->getModel() << endl;
	cout << "In rent: " << (car->getInRent()?"true":"false") << endl;
	cout << "Age: " << car->getAge() << endl;
	cout << "Auto Gearbox: " << (car->getAutoGearbox()?"true":"false") << endl;
	cout << "Number of seats: " << car->getNumSeats() << endl;
	cout << "Number of doors: " << car->getNumDoors() << endl;
	cout << "---------------------------------------------" << endl;
}

int _tmain(int argc, _TCHAR* argv[])
{
	Vehicles vehicles;
	string list[5]={"001","002","003","004","005"};
	int i;

	vehicles.addVehicle("001","Renault","Megane",false,1,false,5,5);
	vehicles.addVehicle("002","Audi","A3",false,1,true,5,5);
	vehicles.addVehicle("003","Renault","Kangoo",true,2,false,5.12,720,2.16);
	vehicles.addVehicle("004","Volkswagen","Golf",false,1,false,5,5);
	vehicles.addVehicle("005","Ford","Transit",false,1,true,6.81,1100,2.38);

	cout << "Vehicle amount: " << vehicles.totalVehicleAmount() << endl;

	vehicles.deleteVehicle("002");

	cout << "Vehicle amount: " << vehicles.totalVehicleAmount() << endl;

	for(i=0;i<5;i++)
	{
		if(vehicles.getVehicleType(list[i])==CAR)
			printVehicleDetails(vehicles.getCar(list[i]));
		else
			printVehicleDetails(vehicles.getVan(list[i]));
	}

	return 0;
}

